import junit.framework.TestCase;
import org.junit.Test;

public class NGuessNumberTest extends TestCase {

    public void setUp() throws Exception {
        super.setUp();
    }

    public void tearDown() throws Exception {
    }

    public void testGenerateAnswer() {

            NGuessNumber nGuessNumber = new NGuessNumber();
            int e[] =nGuessNumber.generateAnswer();
        //判断是不是四个数
        int  []m = new int []{};

        if(m.length==4){
            //判断是不是每个数都不相等
            for(int i=0;i<m.length-1;i++){
                for (int j = m.length-1; j >i; j--) {
                    if (e[i]!=m[j]) {
                        //判断是不都是一位数
                        if(0<m[i]&&m[i]<9) {
                            System.out.println("满足要求");
                        }
                    }
                }
            }
        }
        generateAnswer();
    }



    public void testGetPlayerInput() {
        NGuessNumber nGuessNumber = new NGuessNumber();
        int n[] =nGuessNumber.getPlayerInput();
        if (n.length==4){
            System.out.println("玩家输入了四个数");
        }
    }

    public void testCompareGuessAnswer() {
    }

    @Test
    public int iswin() {
        NGuessNumber nGuessNumber = new NGuessNumber();
        int B=nGuessNumber.iswin();
        if (B==4){
            System.out.println("true");
        }else{
            System.out.println("false");
        }
        return B;
    }
}
}